from PO.Base.Base import Base
from selenium.webdriver.common.by import By
import time
# 页面类层
class Page(Base):
    # 定位器
    # 请登录
    login_loc=(By.CLASS_NAME,'headerLogin')
    # 断言登录前页面文字“帐号登录”
    dy1_text=(By.XPATH,'//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]')
    #输入账号
    name_loc=(By.NAME,'uname')
    #输入密码
    password_loc=(By.ID,'password')
    #点击登录按钮
    login_btn_loc=(By.ID,'bi_Usuallogin')
    # 点击确定按钮
    sure_loc=(By.NAME,'bindSub')

    # 封装相对应的方法
    def login(self):
        self.click(self.login_loc)
    # 封装断言
    def dy1(self):
        return self.log_text(self.dy1_text)
    def name(self):
        self.send_keys(self.name_loc,'18986670716')
    def password(self):
        self.send_keys(self.password_loc,'Aa123456')
    def login_btn(self):
        self.click(self.login_btn_loc)
    def sure(self):
        self.click(self.sure_loc)
    #逻辑
    def jx_lj_01(self):
        self.login()
        # 输出断言
        print(self.dy1())
        self.name()
        self.password()
        time.sleep(10)
        self.login_btn()





